home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / Speech Synthesis Manager / Installer Source / Templates / InstallSplitInTwoFile.r < prev   
Encoding:
Text File  |  1996-11-11  |  4.7 KB  |  122 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    File:        InstallSplitInTwoFile.r -    Rez Source
  4.  *
  5.  *    Author:        Tim Fredenburg
  6.  *                Based on InstallATomeFile.r by Deric Horn.
  7.  *
  8.  *    The template is used for installing a file that has been split into
  9.  *    two pieces by FileAndRsrcSplitterTool.
  10.  *
  11.  *    This templates works ONLY with files that:
  12.  *        • are split into exactly two pieces
  13.  *        • only have a resource fork, no data fork
  14.  *        • have each split piece compressed into separate InstaCompOne archives
  15.  *
  16.  *    To prepare files that will be used by this template your build script
  17.  *    needs to include something like:
  18.  *        FileAndRsrcSplitterTool "Agnes" -s 810000
  19.  *        SetFile -t 'ttvf' -c 'gala' "Agnes.rsrc1"
  20.  *        SetFile -t 'ttvf' -c 'gala' "Agnes.rsrc2"
  21.  *        Echo "Include ∂"Agnes∂" 'vers' (1);" ∂
  22.  *                | Rez -a -o "Agnes.rsrc1"
  23.  *        Echo "Include ∂"Agnes∂" 'vers' (1);" ∂
  24.  *                | Rez -a -o "Agnes.rsrc2"
  25.  *        InstaCompOneTool -e -f "Agnes" "Agnes.rsrc1"  -o "Tome4"
  26.  *        InstaCompOneTool -e -f "Agnes" "Agnes.rsrc2"  -o "Tome3"
  27.  *
  28.  *    We need to set the file type and creator of the split pieces back to the
  29.  *    the original file's type and creator to get around a problem when
  30.  *    running ScriptCheck.  When ScriptCheck tries to get the version of the
  31.  *    file to fill in in the 'infa' it (or the atom extender) thinks it can't find
  32.  *    the file because the type and creator or wrong.  Oddly, there is no problem
  33.  *    getting the file's size though.  Also, we have to copy the 'vers' 1 resource
  34.  *    to the split pieces so that there is a version for ScriptCheck to find.
  35.  *    Note the flags to InstaCompOneTool (-f) renaming the split pieces back to
  36.  *    the name of the original file and also (-e) specifying that the data fork
  37.  *    really belongs in the resource fork.
  38.  *
  39.  *----------------------------------------------------------------------------*/
  40.  
  41. #ifndef    COMPAREPROC
  42.     #define    COMPAREPROC    useVersProcToCompare
  43. #endif
  44. #ifndef    DELETEFILE
  45.     #define    DELETEFILE    deleteWhenRemoving
  46. #endif
  47.  
  48. #ifndef    TARGETTFID
  49.     #define    TARGETTFID    targetFileBase+ID
  50.  
  51.     resource 'intf' (TARGETTFID)
  52.     { 
  53.         format1
  54.         { 
  55.             noSearchForFile,                /* Search by calling the referenced 'insp' resource */
  56.             TypeCrNeedNotMatch,                /* Type and creator must match    */
  57.             FILETYPE,                        /* Target File Type */
  58.             FILECREATOR,                    /* Target File Creator */
  59.             0,                                /* Target File Finder Flags */
  60.             kScriptCheckSetsDate,            /* Target File Creation Date of new file */
  61.             kScriptCheckSetsDate,            /* Target File Mod. Date of new file */
  62.             0,                                /* Search Proc. Rsrc ID */
  63.             DESTDIR FILENAME                /* Destination Path */
  64.         } 
  65.     };
  66. #endif
  67.  
  68. #ifndef    HCDeCompResources
  69.     #define    HCDeCompResources
  70.     #define HCDeCompInexID        241                /* Mister Majic Number */
  71.     include "InstaCompOneAtomExt.rsrc" 'exfn' (HCDeCompInexID); /* Majic Decompressulator */
  72.     include "InstaCompOneAtomExt.rsrc" 'inex' (HCDeCompInexID);
  73. #endif
  74.  
  75. resource 'infa' (sourceFileBase+ID,FILENAME)
  76. {
  77.     format1
  78.     {
  79.         DELETEFILE,                        /* Remove file or rsrc if remove clicked */
  80.         deleteWhenInstalling,             /* Delete target before copy    */
  81.         copy,                             /* Copy file or rsrc to destination */
  82.         dontIgnoreLockedFile,             /* Set the Target file to be locked or not. */
  83.         dontSetFileLocked,                 /* Set the Target file to be locked or not. */
  84.         COMPAREPROC,                     /* How we determine if the target is newer. */
  85.         srcNeedExist,                     /* Ignore atom if file does not exist */
  86.         rsrcForkInDataFork,             /* Determines where to read the rsrc fork from */
  87.         leaveAloneIfNewer,                /* OK for a newer version of this file to exist */
  88.         updateExisting,                 /* Keep tgt file if it already exists */
  89.         copyIfNewOrUpdate,                 /* Only update if target exists    */
  90.         rsrcFork,                         /* Apply operation to rsrc fork */
  91.         dataFork,                         /* Apply operation to data fork    */
  92.         0,                                 /* total size uncomp */            /*SCRIPTCHECK SETS*/
  93.         0,                                 /* Finder Attribute Flags */    /*SCRIPTCHECK SETS*/
  94.         TARGETTFID,                     /* Tgt file spec ID */
  95.         {
  96.             PART1TOMEID,                 /* Source File Spec */ /*  parts list, with exact target part sizes. */
  97.             0,                            /* Target Data Fork Part Size Uncompressed *//*SCRIPTCHECK SETS*/
  98.             0,                            /* Target Rsrc Fork Part Size Uncompressed *//*SCRIPTCHECK SETS*/
  99.  
  100.             PART2TOMEID,                 /* Source File Spec */ /*  parts list, with exact target part sizes. */
  101.             0,                            /* Target Data Fork Part Size Uncompressed *//*SCRIPTCHECK SETS*/
  102.             0                            /* Target Rsrc Fork Part Size Uncompressed *//*SCRIPTCHECK SETS*/
  103.         },
  104.         0x0,                            /* Source Version Number in BCD format. *//*SCRIPTCHECK SETS*/
  105.         0,                                /* Version Compare rsrc ID (zero if none) */
  106.         HCDeCompInexID,                    /* Atom Extender ID */
  107.         FILENAME                        /* Atom Description */
  108.     }
  109. };
  110.  
  111.  
  112. #undef    DELETEFILE
  113. #undef    COMPAREPROC
  114. #undef    TARGETTFID
  115. #undef    ID
  116. #undef    PART1TOMEID
  117. #undef    PART2TOMEID
  118. #undef    FILETYPE
  119. #undef    FILECREATOR
  120. #undef    DESTDIR
  121. #undef    FILENAME
  122.